import type { VbenFormProps } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { Image } from 'ant-design-vue';
import { getComponentApi } from '#/api';
import { z } from '#/adapter/form';
import { h } from 'vue';
import dayjs from 'dayjs';

// 表单通用配置
export const commonFormConfig: VbenFormProps = {
  showCollapseButton: true,
  collapsed: false,
  collapsedRows: 0,
  actionWrapperClass: 'text-center',
  commonConfig: {
    colon: true,
    labelWidth: 160,
    componentProps: {
      class: 'w-full',
    },
  },
  submitButtonOptions: {
    // 按钮显示文本
    content: '下一项',
  },
  resetButtonOptions: {
    content: '上一项',
  },
  layout: 'horizontal',
  // 大屏一行显示3个，中屏一行显示2个，小屏一行显示1个
  // wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-2',
  wrapperClass: 'grid-cols-1',
};

const pictogramImages = [
  '/ghs/GHS01爆炸.png',
  '/ghs/GHS02燃烧.png',
  '/ghs/GHS03氧化.png',
  '/ghs/GHS04高压气体.png',
  '/ghs/GHS05腐蚀.png',
  '/ghs/GHS06有毒.png',
  '/ghs/GHS07有害.png',
  '/ghs/GHS08健康危害.png',
  '/ghs/GHS09环境危害.png',
];
const pkgMarkImages = [
  '/ghs/GHS01爆炸.png',
  '/ghs/GHS02燃烧.png',
  '/ghs/GHS03氧化.png',
  '/ghs/GHS04高压气体.png',
  '/ghs/GHS05腐蚀.png',
  '/ghs/GHS06有毒.png',
  '/ghs/GHS07有害.png',
  '/ghs/GHS08健康危害.png',
  '/ghs/GHS09环境危害.png',
];

// 第一个卡片表单参数定义
export const FirstFormSchemas: VbenFormProps = {
  schema: [
    {
      component: 'ApiSelect',
      componentProps: {
        mode: 'multiple',
        placeholder: '请选择组成成分',
        allowClear: true,
        afterFetch: (data: { name: string; path: string }[]) => {
          // console.log(data);
          return data.map((item: any) => ({
            label: item.name,
            value: item.name,
          }));
        },
        api: getComponentApi,
      },
      label: '组成成分', // $t('page.auth.forgetPassword'),
      fieldName: 'component',
      rules: 'required',
      defaultValue: ['甲烷'],
    },
    {
      component: 'RadioGroup',
      componentProps: {
        optionType: 'button',
        buttonStyle: 'solid',
        options: [
          { label: '物质', value: '物质' },
          { label: '混合物', value: '混合物' },
        ],
      },
      label: '化学品分类',
      fieldName: 'isSubstance',
      rules: 'required',
      defaultValue: '物质',
    },
  ],
};

// 第二个卡片的第一个表单参数定义
export const SecondFormSchemas1: VbenFormProps = {
  schema: [
    {
      component: 'Input',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
      },
      formItemClass: 'col-span-2',
      label: '化学品中文名称',
      fieldName: 'chemNameCn',
      rules: 'required',
      defaultValue: '甲烷',
    },
    {
      component: 'Input',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
      },
      formItemClass: 'col-span-2',
      label: '化学品英文名称',
      fieldName: 'chemNameEn',
      rules: 'required',
      defaultValue: 'Methane',
    },
    {
      component: 'Input',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
      },
      formItemClass: 'col-span-2',
      label: '企业名称',
      fieldName: 'companyName',
      rules: 'required',
      defaultValue: '四川润泰特种气体有限公司',
    },
    {
      component: 'Input',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
      },
      formItemClass: 'col-span-2',
      label: '地址',
      fieldName: 'companyAddr',
      rules: 'required',
      defaultValue: '广汉市连山镇柳埝村七组',
    },
    {
      component: 'InputNumber',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
      },
      label: '邮编',
      fieldName: 'postalCode',
      rules: 'required',
      defaultValue: '618300',
    },
    {
      component: 'Input',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
      },
      label: '电子邮件地址',
      fieldName: 'contactEmail',
      rules: z.string().email('请输入正确的邮箱'),
      defaultValue: 'cs@wintecgas.com',
    },
    {
      component: 'Input',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
      },
      label: '传真',
      fieldName: 'faxNum',
      rules: 'required',
      defaultValue: '0838-6833368',
    },
    {
      component: 'Input',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
      },
      label: '企业应急电话',
      fieldName: 'emerPhone',
      rules: 'required',
      defaultValue: '0838-6833368',
    },
    {
      component: 'Input',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
      },
      formItemClass: 'col-span-2',
      label: '国家应急电话',
      fieldName: 'natEmerPhone',
      rules: 'required',
      defaultValue: '公安报警110、火警电话119、医院急救电话120',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      formItemClass: 'col-span-2',
      label: '产品推荐用途',
      fieldName: 'productUse',
      rules: 'required',
      defaultValue: '用于校准气体分析仪器，评价和检验分析方法，仲裁分析结果，保证测量结果的溯源性和可靠性。',
    },
  ],
};
export const SecondFormSchemas2: VbenFormProps = {
  schema: [
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '紧急情况概述',
      fieldName: 'emerSummary',
      rules: 'required',
      defaultValue: '压缩气体，遇热可能爆炸。如果吸入，请将患者移到新鲜空气处。',
    },
    {
      component: 'ApiSelect',
      componentProps: {
        mode: 'multiple',
        allowClear: true,
        placeholder: '请选择',
        // afterFetch: (data: { name: string; path: string }[]) => {
        //   // console.log(data);
        //   return data.map((item: any) => ({
        //     label: item.name,
        //     value: item.name,
        //   }));
        // },
        // api: getGHSClass,
        api: () => {
          return Promise.resolve([
            { label: '类别1', value: 'class1' },
            { label: '类别2', value: 'class2' },
          ]);
        },
      },
      label: 'GHS 危险性类别', // $t('page.auth.forgetPassword'),
      fieldName: 'ghsHazClass',
      rules: 'required',
      defaultValue: ['class1'],
    },
    {
      component: 'CheckboxGroup',
      componentProps: {
        options: pictogramImages.map((url) => ({
          label: h(Image, {
            src: url,
            width: 40,
            height: 40,
            preview: false,
          }),
          // value为图片链接中为图片名
          value: url.split('/').pop()!.split('.')[0],
        })),
      },
      label: '象形图',
      fieldName: 'pictogram',
      rules: 'required',
      defaultValue: ['GHS04高压气体'],
    },
    {
      component: 'Input',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
      },
      label: '警示词',
      fieldName: 'warningWord',
      rules: 'required',
      defaultValue: '危险',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '危险性说明',
      fieldName: 'hazardDesc',
      rules: 'required',
      defaultValue: '内装高压气体，遇热可能爆炸。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '预防措施',
      fieldName: 'prevMeasure',
      rules: 'required',
      defaultValue: '避免与氧化剂、强碱、强酸、金属及有机溶剂混合使用。\n避免阳光直射。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '事故响应',
      fieldName: 'accResponse',
      rules: 'required',
      defaultValue: '如果吸入，请将患者移到新鲜空气处。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '安全储存',
      fieldName: 'safeStorage',
      rules: 'required',
      defaultValue: '储存在阴凉通风处，保持容器密闭。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '废弃处置',
      fieldName: 'disposalMethod',
      rules: 'required',
      defaultValue: '本品及内装物、容器依据国家和地方法规处置。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '物理和化学危险',
      fieldName: 'physChemHaz',
      rules: 'required',
      defaultValue: '内装高压气体，遇热可能爆炸。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '健康危害',
      fieldName: 'healthHazard',
      rules: 'required',
      defaultValue: '吸入有害气体，可能引起头晕、头痛、恶心、呕吐、皮肤刺激等。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '环境危害',
      fieldName: 'envHazard',
      rules: 'required',
      defaultValue: '可能对环境造成污染。',
    },
  ],
};
export const SecondFormSchemas3: VbenFormProps = {
  schema: [
    {
      label: '成分信息',
      hideLabel: true,
      fieldName: 'compInfoSlot', // 使用名为compInfoTable的slot插槽，优先于component属性
      component: 'Input',
    },
  ],
};
export const compInfoTableSchemas: VxeGridProps = {
  rowConfig: {
    useKey: true,
    drag: true,
    isHover: true,
  },
  columnConfig: {
    useKey: true,
  },
  columns: [
    { fixed: 'left', type: 'checkbox', minWidth: 90, title: '全选', dragSort: true },
    { editRender: { name: 'input', enable: true }, minWidth: 180, field: 'compName', title: '组分' },
    { editRender: { name: 'input', enable: true }, minWidth: 100, field: 'compConc', title: '浓度(%)' },
    { editRender: { name: 'input', enable: true }, minWidth: 100, field: 'casNo', title: 'CAS号' },
    { editRender: { name: 'input', enable: true }, minWidth: 180, field: 'hazCat', title: '类别' },
    // {
    //   field: 'position',
    //   title: '位置',
    //   minWidth: 120,
    //   slots: { edit: 'edit_position', default: 'edit_position' },
    // },
    {
      fixed: 'right',
      width: 60,
      title: '操作',
      visible: true,
      slots: { edit: 'cellstool', default: 'cellstool' },
    },
  ],
  data: [], // MOCK_TABLE_DATA,
  pagerConfig: {
    enabled: false,
  },
  sortConfig: {
    multiple: true,
  },
  validConfig: {
    msgMode: 'full', //验证时为同时多个错误提示模式
  },
  editConfig: {
    mode: 'cell',
    trigger: 'dblclick',
    showIcon: false,
    // showStatus: true,
  },
  editRules: {
    compName: [{ required: true, message: '请输入组分' }],
    compConc: [
      {
        required: true,
        type: 'number',
        pattern: `^(0?\.[1-9][0-9]*|[1-9][0-9]?(\.[0-9]+)?|100)$`,
        message: '输入格式有误',
      },
    ],
    casNo: [
      // 正则表达式校验，只能包含数字和-，且-不能在开头或结尾，也不能连续出现
      { required: true, pattern: '^(?!-)(?!.*--)[0-9-]+(?<!-)$', message: '输入格式有误' },
    ],
    hazCat: [{ required: true, message: '请输入类别' }],
  },
};

export const SecondFormSchemas4: VbenFormProps = {
  schema: [
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '吸入',
      fieldName: 'inhaleAid',
      rules: 'required',
      defaultValue: '迅速转移至空气新鲜处，若无呼吸，立即进行人工呼吸。若呼吸困难，输氧，就医。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '皮肤接触',
      fieldName: 'skinAid',
      rules: 'required',
      defaultValue: '若有冻伤，用温水复温，立即就医。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '眼睛接触',
      fieldName: 'eyeAid',
      rules: 'required',
      defaultValue: '谨慎起见，用水冲洗眼睛。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '对保护施救者的忠告',
      fieldName: 'rescuerAdv',
      rules: 'required',
      defaultValue: '根据需要使用个人防护用品。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '对医生的特别提示',
      fieldName: 'doctorNote',
      rules: 'required',
      defaultValue: '对症处理。',
    },
  ],
};
export const SecondFormSchemas5: VbenFormProps = {
  schema: [
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '灭火剂',
      fieldName: 'extAgent',
      rules: 'required',
      defaultValue: '雾状水、泡沫、二氧化碳、干粉。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '特别危险性',
      fieldName: 'specHazard',
      rules: 'required',
      defaultValue: '若与高热，容器内压增大，有开裂和爆炸的危险。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '灭火注意及防护',
      help: '灭火注意事项及防护措施',
      fieldName: 'firePrecaution',
      rules: 'required',
      defaultValue: '将危险区域的人员疏散，从远处向钢瓶喷水降温，在无危险的情况下，将钢瓶移出火灾区域并止住泄漏。',
    },
  ],
};
export const SecondFormSchemas6: VbenFormProps = {
  schema: [
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '作业人员防护和应急',
      help: '作业人员防护措施、防护装备和应急处置程序',
      fieldName: 'leakProtect',
      rules: 'required',
      defaultValue:
        '根据气体扩散的影响区域划定警戒区，无关人员从侧风、上风向撤离至安全区。建议应急处理人员戴正压自给式呼吸器，穿防静电工作服。尽可能切断泄漏源。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '环境保护措施',
      fieldName: 'envProtect',
      rules: 'required',
      defaultValue: '如能确保安全，可采取措施防止进一步的泄漏。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '泄漏化学品的处置',
      help: '泄漏化学品的收容、清除方法及所使用的处置材料',
      fieldName: 'leakCleanup',
      rules: 'required',
      defaultValue:
        '保护气瓶下于良好通风或户外，然后缓慢将废气直接排入大气。请注意当地废弃处置法规，将该物质及其容器送回本公司处置。',
    },
  ],
};
export const SecondFormSchemas7: VbenFormProps = {
  schema: [
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '操作注意事项',
      fieldName: 'handleNote',
      rules: 'required',
      defaultValue:
        '使用合适的工具搬运钢瓶，切忌野蛮操作。严禁使用钢瓶帽吊装。严禁插入物件（如拍扳手、起子、撬杠等）来开启瓶帽，这样会危害阀门，导致泄漏。用可调皮带拍扳手开启过紧或锈蚀瓶帽。缓慢开启阀门，如果阀门难以打开，不要使用并联系供应商。每次用完后关闭阀门。当气瓶空后保持关闭。密闭操作，加强通风。操作员必须经过专门培训，严格遵守操作规程，必要时佩戴自给式呼吸器，遵守规章制度，遵守劳动纪律。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '储存注意事项',
      fieldName: 'envProtect',
      rules: 'required',
      defaultValue:
        '应存放于通风良好，远离火种、热源，温度不高于50℃的地方。存放时，钢瓶应处于直立状态，用防倾倒链条固定，装好阀门保护罩。空、满瓶分开储存。以先进先出的原则，保证满瓶勿长时间存放。',
    },
  ],
};
export const SecondFormSchemas8: VbenFormProps = {
  schema: [
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '职业接触限值-中国',
      fieldName: 'occLimitCn',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '职业接触限值-美国',
      fieldName: 'occLimitUs',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '生物接触限值',
      fieldName: 'bioLimit',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '空气中有毒物质测定',
      fieldName: 'airTestMtd',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '生物监测检验方法',
      fieldName: 'bioTestMtd',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      formItemClass: 'col-span-2',
      label: '工程控制',
      fieldName: 'engControl',
      rules: 'required',
      defaultValue: '密闭操作。提供良好的自然通风条件。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      formItemClass: 'col-span-2',
      label: '呼吸系统防护',
      fieldName: 'respProtect',
      rules: 'required',
      defaultValue: '一般不需特殊防护。当作业场所空气中氧气浓度低于18%时，必须佩戴空气呼吸器或长管面具。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      formItemClass: 'col-span-2',
      label: '眼睛防护',
      fieldName: 'eyeProtect',
      rules: 'required',
      defaultValue: '一般不需特殊防护。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      formItemClass: 'col-span-2',
      label: '皮肤和身体防护',
      fieldName: 'skinProtect',
      rules: 'required',
      defaultValue: '穿一般作业工作服。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      formItemClass: 'col-span-2',
      label: '手防护',
      fieldName: 'handProtect',
      rules: 'required',
      defaultValue: '佩戴一般作业防护手套。',
    },
  ],
};
export const SecondFormSchemas9: VbenFormProps = {
  schema: [
    {
      label: '理化特性',
      hideLabel: true,
      fieldName: 'chemPropsSlot', // 使用名为chemPropsTable的slot插槽，优先于component属性
      component: 'Input',
    },
  ],
};
export const chemPropsTableSchemas: VxeGridProps = {
  rowConfig: {
    useKey: true,
    drag: true,
    isHover: true,
  },
  columnConfig: {
    useKey: true,
  },
  columns: [
    { fixed: 'left', type: 'checkbox', minWidth: 90, title: '全选', dragSort: true },
    { fixed: 'left', minWidth: 180, field: 'chemName', title: '名称' },
    { editRender: { name: 'input', enable: true }, minWidth: 180, field: 'appearance', title: '外观与性状' },
    { editRender: { name: 'input', enable: true }, minWidth: 60, field: 'phValue', title: 'pH值' },
    { editRender: { name: 'input', enable: true }, minWidth: 50, field: 'meltPoint', title: '熔点\n(℃)' },
    { editRender: { name: 'input', enable: true }, minWidth: 50, field: 'boilPoint', title: '沸点\n(℃)' },
    { editRender: { name: 'input', enable: true }, minWidth: 80, field: 'relDensity', title: '相对密度\n(水=1)' },
    { editRender: { name: 'input', enable: true }, minWidth: 110, field: 'vaporDens', title: '相对蒸气密度\n(空气=1)' },
    { editRender: { name: 'input', enable: true }, minWidth: 100, field: 'vaporPress', title: '饱和蒸气压\n(kPa)' },
    { editRender: { name: 'input', enable: true }, minWidth: 80, field: 'critPress', title: '临界压力\n(MPa)' },
    { editRender: { name: 'input', enable: true }, minWidth: 80, field: 'octanolCoef', title: '辛醇/水\n分配系数' },
    { editRender: { name: 'input', enable: true }, minWidth: 50, field: 'flashPoint', title: '闪点\n(℃)' },
    { editRender: { name: 'input', enable: true }, minWidth: 80, field: 'igniteTemp', title: '自燃温度\n(℃)' },
    { editRender: { name: 'input', enable: true }, minWidth: 80, field: 'explLower', title: '爆炸下限\n[%(V/V)]' },
    { editRender: { name: 'input', enable: true }, minWidth: 80, field: 'explUpper', title: '爆炸上限\n[%(V/V)]' },
    { editRender: { name: 'input', enable: true }, minWidth: 80, field: 'decompTemp', title: '分解温度\n(℃)' },
    { editRender: { name: 'input', enable: true }, minWidth: 70, field: 'viscosity', title: '黏度\n(mPa.s)' },
    { editRender: { name: 'input', enable: true }, minWidth: 80, field: 'combustHeat', title: '燃烧热\n(kJ/mol)' },
    { editRender: { name: 'input', enable: true }, minWidth: 80, field: 'critTemp', title: '临界温度\n(℃)' },
    { editRender: { name: 'input', enable: true }, minWidth: 160, field: 'solubility', title: '溶解性' },
    {
      fixed: 'right',
      width: 60,
      title: '操作',
      visible: true,
      slots: { edit: 'cellstools', default: 'cellstools' },
    },
  ],
  data: [], // MOCK_TABLE_DATA,
  pagerConfig: {
    enabled: false,
  },
  sortConfig: {
    multiple: true,
  },
  validConfig: {
    msgMode: 'full', //验证时为同时多个错误提示模式
  },
  editConfig: {
    mode: 'cell',
    trigger: 'dblclick',
    showIcon: false,
    // showStatus: true,
  },
  editRules: {
    appearance: [{ required: true, message: ' 请输入外观与性状 ' }],
    // phValue: [{required: true, message: ' 请输入 pH 值 '}],
    // meltPoint: [{required: true, message: ' 请输入熔点 (℃)' }],
    // boilPoint: [{required: true, message: ' 请输入沸点 (℃)' }],
    // relDensity: [{required: true, message: ' 请输入相对密度 (水 = 1)' }],
    // vaporDens: [{required: true, message: ' 请输入相对蒸气密度 (空气 = 1)' }],
    // vaporPress: [{required: true, message: ' 请输入饱和蒸气压 (kPa)' }],
    // critPress: [{required: true, message: ' 请输入临界压力 (MPa)' }],
    // octanolCoef: [{required: true, message: ' 请输入辛醇 / 水分配系数 '}],
    // flashPoint: [{required: true, message: ' 请输入闪点 (℃)' }],
    // igniteTemp: [{required: true, message: ' 请输入自燃温度 (℃)' }],
    // explLower: [{required: true, message: ' 请输入爆炸下限 [%(V/V)]' }],
    // explUpper: [{required: true, message: ' 请输入爆炸上限 [%(V/V)]' }],
    // decompTemp: [{required: true, message: ' 请输入分解温度 (℃)' }],
    // viscosity: [{required: true, message: ' 请输入黏度（mPa.s）'}],
    // combustHeat: [{required: true, message: ' 请输入燃烧热 (kJ/mol)' }],
    // critTemp: [{required: true, message: ' 请输入临界温度 (℃)' }],
    // solubility: [{required: true, message: ' 请输入溶解性 '}]
  },
};

export const SecondFormSchemas10: VbenFormProps = {
  schema: [
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '稳定性',
      fieldName: 'stability',
      rules: 'required',
      defaultValue: '在建议的储存条件下是稳定的。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '危险反应',
      fieldName: 'hazardReact',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '避免接触的条件',
      fieldName: 'avoidCond',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '禁配物',
      fieldName: 'incompat',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '危险的分解产物',
      fieldName: 'decompProd',
      rules: 'required',
      defaultValue: '无资料。',
    },
  ],
};
export const SecondFormSchemas11: VbenFormProps = {
  schema: [
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '急性毒性',
      fieldName: 'acuteToxic',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '皮肤刺激或腐蚀',
      fieldName: 'skinIrrit',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '眼睛刺激或腐蚀',
      fieldName: 'eyeIrrit',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '呼吸或皮肤过敏',
      fieldName: 'respAllergy',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '生殖细胞突变性',
      fieldName: 'germMut',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '致癌性',
      fieldName: 'carcinogen',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '生殖毒性',
      fieldName: 'reprodToxic',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '系统毒性-一次接触',
      help: '特异性靶器官系统毒性-一次接触',
      fieldName: 'targOrg1',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '系统毒性-反复接触',
      help: '特异性靶器官系统毒性-反复接触',
      fieldName: 'targOrgRep',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '吸入危害',
      fieldName: 'inhaleHaz',
      rules: 'required',
      defaultValue: '无资料。',
    },
  ],
};
export const SecondFormSchemas12: VbenFormProps = {
  schema: [
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '生态毒性',
      fieldName: 'ecoToxic',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '生物降解性',
      fieldName: 'biodeg',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '非生物降解性',
      fieldName: 'abioDeg',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '潜在的生物累积性',
      fieldName: 'bioaccum',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '土壤中的迁移性',
      fieldName: 'soilMobility',
      rules: 'required',
      defaultValue: '无资料。',
    },
  ],
};
export const SecondFormSchemas13: VbenFormProps = {
  schema: [
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '废弃化学品',
      fieldName: 'chemDispose',
      rules: 'required',
      defaultValue:
        '不要尝试处理残留和剩余物，请送回本公司处理。紧急情况下，保护气瓶处于良好通风或户外，然后缓慢将废气直接排入大气。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '污染包装物',
      fieldName: 'contamPkg',
      rules: 'required',
      defaultValue: '将容器送回本公司或按国家和地方法规处置。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '废弃注意事项',
      fieldName: 'dispNote',
      rules: 'required',
      defaultValue: '处置前应参阅国家和地方法规。',
    },
  ],
};
export const SecondFormSchemas14: VbenFormProps = {
  schema: [
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: 'UN号',
      help: '联合国危险货物编号',
      fieldName: 'unNumber',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '联合国运输名称',
      fieldName: 'transName',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '联合国危险性类别',
      fieldName: 'transHazCls',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '包装类别',
      fieldName: 'pkgClass',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'CheckboxGroup',
      componentProps: {
        options: pkgMarkImages.map((url) => ({
          label: h(Image, {
            src: url,
            width: 40,
            height: 40,
            preview: false,
          }),
          value: url.split('/').pop()!.split('.')[0],
        })),
      },
      formItemClass: 'col-span-2',
      label: '包装标志',
      fieldName: 'pkgMark',
      rules: 'required',
      defaultValue: ['GHS04高压气体'],
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '海洋污染物',
      fieldName: 'marinePoll',
      rules: 'required',
      defaultValue: '无资料。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '运输注意事项',
      fieldName: 'transNote',
      rules: 'required',
      defaultValue: '无资料。',
    },
  ],
};
export const SecondFormSchemas15: VbenFormProps = {
  schema: [
    {
      component: 'RadioGroup',
      componentProps: {
        optionType: 'button',
        buttonStyle: 'solid',
        options: [
          { label: '未列入', value: '未列入。' },
          { label: '列入', value: '列入。' },
        ],
      },
      label: '职业病分类和目录',
      fieldName: 'occDiseaseCat',
      rules: 'required',
      defaultValue: '未列入。',
    },
    {
      component: 'RadioGroup',
      componentProps: {
        optionType: 'button',
        buttonStyle: 'solid',
        options: [
          { label: '未列入', value: '未列入。' },
          { label: '列入', value: '列入。' },
        ],
      },
      label: '危险化学品目录',
      fieldName: 'hazChemList',
      rules: 'required',
      defaultValue: '未列入。',
    },
    {
      component: 'RadioGroup',
      componentProps: {
        optionType: 'button',
        buttonStyle: 'solid',
        options: [
          { label: '未列入', value: '未列入。' },
          { label: '列入', value: '列入。' },
        ],
      },
      label: '易制爆危险化学品名录',
      fieldName: 'expChemList',
      rules: 'required',
      defaultValue: '未列入。',
    },
    {
      component: 'RadioGroup',
      componentProps: {
        optionType: 'button',
        buttonStyle: 'solid',
        options: [
          { label: '未列入', value: '未列入。' },
          { label: '列入', value: '列入。' },
        ],
      },
      label: '重点监管危化品名录',
      help: '重点监管危险化学品名录',
      fieldName: 'imhazChemList',
      rules: 'required',
      defaultValue: '未列入。',
    },
    {
      component: 'RadioGroup',
      componentProps: {
        optionType: 'button',
        buttonStyle: 'solid',
        options: [
          { label: '未列入', value: '未列入。' },
          { label: '列入', value: '列入。' },
        ],
      },
      label: '危化品危险源辨识表',
      help: '《危险化学品重大危险源辨识》表 1',
      fieldName: 'majorHazard',
      rules: 'required',
      defaultValue: '未列入。',
    },
    {
      component: 'RadioGroup',
      componentProps: {
        optionType: 'button',
        buttonStyle: 'solid',
        options: [
          { label: '未列入', value: '未列入。' },
          { label: '列入', value: '列入。' },
        ],
      },
      label: '高毒物品目录',
      fieldName: 'highToxList',
      rules: 'required',
      defaultValue: '未列入。',
    },
    {
      component: 'RadioGroup',
      componentProps: {
        optionType: 'button',
        buttonStyle: 'solid',
        options: [
          { label: '未列入', value: '未列入。' },
          { label: '列入', value: '列入。' },
        ],
      },
      label: '易制毒化学品目录',
      fieldName: 'ctrlChemList',
      rules: 'required',
      defaultValue: '未列入。',
    },
    {
      component: 'RadioGroup',
      componentProps: {
        optionType: 'button',
        buttonStyle: 'solid',
        options: [
          { label: '未列入', value: '未列入。' },
          { label: '列入', value: '列入。' },
        ],
      },
      label: '斯德哥尔摩公约',
      fieldName: 'stkhlmConv',
      rules: 'required',
      defaultValue: '未列入。',
    },
    {
      component: 'RadioGroup',
      componentProps: {
        optionType: 'button',
        buttonStyle: 'solid',
        options: [
          { label: '未列入', value: '未列入。' },
          { label: '列入', value: '列入。' },
        ],
      },
      label: '鹿特丹公约',
      fieldName: 'rotterConv',
      rules: 'required',
      defaultValue: '未列入。',
    },
    {
      component: 'RadioGroup',
      componentProps: {
        optionType: 'button',
        buttonStyle: 'solid',
        options: [
          { label: '未列入', value: '未列入。' },
          { label: '列入', value: '列入。' },
        ],
      },
      label: '蒙特利尔议定书',
      fieldName: 'mtlProtocol',
      rules: 'required',
      defaultValue: '未列入。',
    },
  ],
};
export const SecondFormSchemas16: VbenFormProps = {
  schema: [
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      formItemClass: 'col-span-2',
      label: '修改说明',
      fieldName: 'revNote',
      rules: 'required',
      defaultValue: '本SDS按照《化学品安全技术说明书编写指南》(GBT17519-2013)标准制。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      formItemClass: 'col-span-2',
      label: '其它储存和使用危险',
      help: '其它操作储存和使用的危险情况',
      fieldName: 'otherHdlStorHaz',
      rules: 'required',
      defaultValue:
        '高压气体，使用的管道和设备需经设计能够承受相应的压力和温度。在管道中使用防逆流装置。气体可以导致缺氧快速窒息。在充足的通风条件下储存和使用。禁止将气瓶放置在可能产生电气回路的地方。',
    },
    {
      component: 'DatePicker',
      componentProps: {
        placeholder: '请选择',
        showTime: false,
        allowClear: true,
        format: 'YYYY年MM月',
        picker: 'month',
        mode: 'month',
      },
      label: '填表时间',
      fieldName: 'fillDate',
      rules: 'selectRequired',
      defaultValue: dayjs(),
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      label: '填表部门',
      fieldName: 'fillDept',
      rules: 'required',
      defaultValue: 'WTC生技部',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      formItemClass: 'col-span-2',
      label: '参考文献',
      fieldName: 'refDocs',
      rules: 'required',
      defaultValue: 'WTCSDS、《危险化学品安全技术大典》等。',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
        autoSize: true,
      },
      formItemClass: 'col-span-2',
      label: '其它信息',
      fieldName: 'otherInfo',
      rules: 'required',
      defaultValue:
        '根据MSDS及商标上的说明向供应商索取免费的四川润泰特种气体有限公司安全文献，四川润泰特种气体有限公司要求本产品的使用者详细阅读产品的SDS，并了解产品的危险性和安全信息。为提高使用本产品的安全性，使用者应做到：①告知其顾员、代理商和承包商SDS上的信息和其他任何已知的产品的危害性和安全信息；②向本产品的购买者提供相关的SDS的资料；③要求本产品的购买者向他的雇员、客户提供产品危害性和安全信息。',
    },
  ],
};

// 第三个卡片表单参数定义
export const ThirdFormSchemas: VbenFormProps = {
  schema: [
    {
      component: 'Input',
      componentProps: {
        placeholder: '请输入',
        allowClear: true,
      },
      label: '化学品英文名称',
      fieldName: 'che',
      rules: 'required',
    },
  ],
};
